package cupk.cars;

import cupk.cars.entities.*;

public class Factory {
    public static Cars getCarName(String carName){
        Cars car=null;
        if (carName.equals("奔驰")){
            car = new EntityBenz();
        } else if(carName.equals("奥迪")){
            car = new EntityAudi();
        } else if(carName.equals("宝马")){
            car = new EntityBmw();
        } else if(carName.equals("特斯拉")){
            car = new EntityTesla();
        }
        return car;
    }
}